<?php
class ArticleAction extends BaseAction{
	protected $msg = '文章';

	public function setFilter(){
		if(isset($_GET['word']) && !empty($_GET['word']))
			$this->where['title'] = array('like','%'.trim($_GET['word']).'%');
		if(isset($_GET['ckey']) && !empty($_GET['ckey'])){
			$csign = M("ArticleType")->where("`key`='{$_GET['ckey']}'")->find();
			if($csign)
				$this->where['cid'] = array('eq',$csign['id']);
		}
	}

    public function data(){
        if(isset($_GET['ckey']) && !empty($_GET['ckey'])){
            $tsign = D("ArticleType")->where("`key`='{$_GET['ckey']}'")->find();
            $this->assign('tsign',$tsign);
        }
        parent::data();
    }
}
?>